def plus_number():
    """输入两个数字，返回数字之和"""
    print("输入'quit'退出循环.")
    while True:
        # 判断输入值，决定继续还是退出循环
        first_num = input("first number:")
        if first_num == 'quit':
            break
        second_num = input("second number:")
        if second_num == 'quit':
            break
        # 进行运算，如有异常捕获异常
        try:
            plus = int(first_num) + int(second_num)
        except ValueError:
            print("您的输入有误，请输入正确的数字。")
        else:
            print("{} + {} = {}".format(first_num, second_num, plus))

# 调用函数
plus_number()
